package com.whc.api.client.fallback;

import com.whc.api.client.GoodsClient;
import com.whc.api.client.PayClient;
import com.whc.api.dto.GoodsCreateDto;
import com.whc.api.dto.OrderDto;
import com.whc.api.dto.PayApplyDTO;
import com.whc.common.domain.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;


@Slf4j
public class PayClientFallback implements FallbackFactory<PayClient> {


    @Override
    public PayClient create(Throwable cause) {
        return new PayClient() {
            @Override
            public Result addPay(PayApplyDTO payApplyDTO) {
                return Result.error("支付微服务错误");
            }

            @Override
            public Result deletePay(Long payId) {
                return Result.error("支付微服务错误");
            }

            @Override
            public Result toPay(Long payId) {
                return Result.error("支付微服务错误");
            }

            @Override
            public Result<Integer> selectPayByOrderId(Long orderId) {
                return Result.error("支付微服务错误");
            }
        };
    }
}
